package Array.constructor;

public class Student1 {
    private String name;
    private int age;
    //无参数结构方法
    public Student1() {}
    public void getname(String name) {
        this.name = name;
    }

    public String setname() {
        return name;
    }

    public void getage(int age) {
        this.age = age;
    }

    public int setage() {
        return age;
    }
   //有参数结构方法
    public Student1(String name, int age){
        this.name=name;
        this.age=age;
        }
    public void show(){
        System.out.println(name+"-------"+age);
    }
}
